package com.dkd.manage.service.impl;

import java.util.List;
import com.dkd.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dkd.manage.mapper.RepairCategoryMapper;
import com.dkd.manage.domain.RepairCategory;
import com.dkd.manage.service.IRepairCategoryService;

/**
 * 维修分类Service业务层处理
 * 
 * @author czq
 * @date 2024-11-09
 */
@Service
public class RepairCategoryServiceImpl implements IRepairCategoryService 
{
    @Autowired
    private RepairCategoryMapper repairCategoryMapper;

    /**
     * 查询维修分类
     * 
     * @param id 维修分类主键
     * @return 维修分类
     */
    @Override
    public RepairCategory selectRepairCategoryById(Long id)
    {
        return repairCategoryMapper.selectRepairCategoryById(id);
    }

    /**
     * 查询维修分类列表
     * 
     * @param repairCategory 维修分类
     * @return 维修分类
     */
    @Override
    public List<RepairCategory> selectRepairCategoryList(RepairCategory repairCategory)
    {
        return repairCategoryMapper.selectRepairCategoryList(repairCategory);
    }

    /**
     * 新增维修分类
     * 
     * @param repairCategory 维修分类
     * @return 结果
     */
    @Override
    public int insertRepairCategory(RepairCategory repairCategory)
    {
        repairCategory.setCreateTime(DateUtils.getNowDate());
        return repairCategoryMapper.insertRepairCategory(repairCategory);
    }

    /**
     * 修改维修分类
     * 
     * @param repairCategory 维修分类
     * @return 结果
     */
    @Override
    public int updateRepairCategory(RepairCategory repairCategory)
    {
        repairCategory.setUpdateTime(DateUtils.getNowDate());
        return repairCategoryMapper.updateRepairCategory(repairCategory);
    }

    /**
     * 批量删除维修分类
     * 
     * @param ids 需要删除的维修分类主键
     * @return 结果
     */
    @Override
    public int deleteRepairCategoryByIds(Long[] ids)
    {
        return repairCategoryMapper.deleteRepairCategoryByIds(ids);
    }

    /**
     * 删除维修分类信息
     * 
     * @param id 维修分类主键
     * @return 结果
     */
    @Override
    public int deleteRepairCategoryById(Long id)
    {
        return repairCategoryMapper.deleteRepairCategoryById(id);
    }
}
